package com.ray.pojo.attend;

import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector;
import com.ray.pojo.QuerySummaryBodyPojo;
import com.ray.util.MathUtil;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class SummaryBodyPojo {
	
	private Integer userId;//用户id
	private String workerNo;//工号
	private String userName;//用户名
	private String deptName;//部门名称
	private String workshopName;//车间
	private String groupName;//考勤组名称
	private String method;//计薪方式
	private Double lateDuration;//迟到时长（毫秒数）
	private String lateDurationStr;//迟到时长（毫秒数）
	private Double earlyDuration;//早退时长（毫秒数）
	private String earlyDurationStr;//早退时长（毫秒数）
	private Double workTimeDuration;//工作时长
	private String workTimeDurationStr;//工作时长
	private Double workOvertimeDuration;//休息日加班时长
	private String workOvertimeDurationStr;//休息日加班时长
	private Double leaveDuration;//请假时长(毫秒)
	private String leaveDurationStr;//请假时长(毫秒)
	private Double realSalary;//当天薪水
	private Double attendanceSalary;//出勤工资
	private Double socialSecurity;//社保
	private Double accumulationFund;//公积金
	private Double otherAddition;//其他加项
	private Double otherDeduction;//其他减项
	private Double pieceWage;//计件工资
	private Double electricFee;//电费
	private Double waterFee;//水费
	private Double applyRepairMoney;//补料扣款
	private Double administrativePenaltyForAward;//行政奖励
	private Double administrativePenaltyForPunish;//行政处罚
	
	private List<Map<String, Object>> workdateList;
	private List<LeaveInfoPojo> leaveList;
	
	public SummaryBodyPojo() {
		super();
	}
	
	public SummaryBodyPojo(Integer userId,String userName,String deptName,String groupName,String method,String workerNo) {
		this.userId = userId;
		this.userName = userName;
		this.deptName = deptName;
		this.groupName = groupName;
		this.method = method;
		this.workerNo = workerNo;
	}
	
	public SummaryBodyPojo(QuerySummaryBodyPojo pojo) {
		this.deptName = pojo.getDeptName();
		this.userId = pojo.getUserId();
		this.userName = pojo.getUserName();
		this.groupName = pojo.getGroupName();
		this.method = pojo.getMethod();
		this.leaveList = pojo.getLeaveList();
		this.workerNo = pojo.getWorkerNo();
	}
	
	public void setRealSalary(Double realSalary) {
		this.realSalary = MathUtil.doubleFormatRoundDown(realSalary < 0.0 ? 0 : realSalary, 2);
	}
	
	public void setAttendanceSalary(Double attendanceSalary) {
		this.attendanceSalary = MathUtil.doubleFormatRoundDown(attendanceSalary < 0.0 ? 0 : attendanceSalary, 2);
	}
	
}
